<admintpl file="header" />

<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />
<link href="__PUBLIC__/js/jquery-ui/jquery-ui.min.css" rel="stylesheet" />

<style type="text/css">
    #from, #to {
        width: 100px;
    }
</style>
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('SupervisionSideReport/index')}">旁站记录管理</a></li>
            <li class="active"><a href="{:U('SupervisionSideReport/add')}">新增旁站记录</a></li>
        </ul>
        <form method="post" class="form-horizontal " action="{:U('SupervisionSideReport/add_post')}">
            <section class="tab-pane active fade in" id="access">
                <div class="row">
                    <div class="col-xs-12 col-md-12 col-lg-12">
                        <div class="panel panel-info">
                            <div class="panel-body">
                                <div class="row tg-header">
                                    <div class="col-md-12 text-center">
                                        <h3>旁站记录</h3>
                                        <hr />
                                    </div>
                                    <div class="col-md-12">
                                        <p class="tg-to"><label>工程名称:</label><input type="text" class="input-xt input-deptname"  value="{$job_name}"  /></p>
                                        <p class="pull-right tg-serialnum"><label>编号:</label><input class="input-xt" name="code" required/></p>
                                    </div>
                                </div>
                                <table class="table table-bordered">
                                    <tr>
                                        <td style="border-right:none !important;">
                                            <label>旁站的关键部位、关键工序:</label>
                                        </td>
                                        <td>
                                            <input type="text" class="input-xt input-deptname"  name="side_position" required/>
                                        </td>
                                        <td style="border-right:none !important;">
                                            <label>施工单位:</label>
                                        </td>
                                        <td>
                                            <select name="executing_department" required style=" height:30px;width:100%">
	                                    		<volist name="depts" id="vo">
	                                    			<option id="{$vo.id}">{$vo.department_name}</option>
	                                    		</volist>	
                                    		</select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label>旁站开始时间</label>
                                        </td>
                                        <td>
                                            <input type="text" name="side_begin_time" id="from" class="input-xt input-deptname WdatePicker" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'to\')}',dateFmt:'yyyy-MM-dd HH:mm'})"
                                             style="width:200px;"  required/>
                                        </td>
                                        <td>
                                            <label>旁站结束时间</label>
                                        </td>
                                        <td>
                                            <input type="text" name="side_end_time" id="to" class="input-xt input-deptname" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'from\')}',dateFmt:'yyyy-MM-dd HH:mm'})"
                                             style="width:200px;" required/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <label>旁站的关键部位、关键工序施工情况：</label>
                                            <textarea style="height:200px; width:100%" name="side_position_construction_status" required></textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <label>发现的问题及处理情况：</label>
                                            <textarea style="height:200px; width:100%" name="problem_and_solution" required></textarea>
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <p class="indent20">
                                                <lable>附件：</lable>
                                                <div class="controls">
                                                    <a class="btn upBtn btn-primary" href="javascript:void(0);">上传</a>
                                                    <input type="file" id="upFile" name="upFile" style="display:none" />
                                                </div>
                                            </p> 
                                                <div class="signature">
                                                    <p>
                                                        <label>旁站监理人员（签字）</label>
                                                    </p>
                                                </div>
                                            <p class="signature-date">
                                                <input type="text" class="js-date input-xt" name="publish_time" value="<php>echo date('Y-m-d');</php>" required />
                                            </p>
                                        </td>                                       
                                    </tr>
                                </table>
                                <div class="form-actions">
                                    <button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
                                    <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </form>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
        <script type="text/javascript">
        $(document).ready(function(e) {
            
            // 选择图片
            $(document).on("click", ".upBtn", function(e) {
                $("#upFile").click();
            });
            // 文件选择器change事件
            $("#upFile").on("change", function(){
                UploadFile("{:U('SupervisionSideReport/upload')}", "supervision_side_report");
            });
            $(document).on("click", ".delFile", function(){
                if($(this).attr("value") != undefined){
                    delFile("{:U('SupervisionSideReport/delFile')}", $(this).attr("value"), $(this))
                } else {
                    $(this).closest("div").remove();
                }
            });
        });
    </script>
</body>
</html>